package com.socket.server;

import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;

/**
 * @author wangg
 * @date 2019/4/9 13:48
 */
class BaseReply {
    private final OutputStream outputStream;

    protected BaseReply(OutputStream outputStream) {
        this.outputStream = outputStream;
    }

    public String execute(String replyMsg) throws IOException {

        outputStream.write(replyMsg.getBytes(StandardCharsets.UTF_8));
        outputStream.flush();
        return replyMsg;
    }
}
